﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HotTopicWinUi.UI
{
    /// <summary>
    /// TopicPanel.xaml 的交互逻辑
    /// </summary>

    public partial class TopicPanel : UserControl
    {

        public class TopicPannelViewMode
        {
            public string TopicContainerTitle { get; set; }
            public List<TopicZdfViewMode> TopicList { get;set;}
        }

        public class TopicZdfViewMode
        {
            public string TopicName { get; set; }
            public float TopicZdf { get; set; }
        }

        public static readonly DependencyProperty TopicContainerTitleProperty =
           DependencyProperty.Register("TopicContainerTitle", typeof(string),typeof(TopicPanel),new PropertyMetadata("TextBox", new PropertyChangedCallback(OnTitleChange)));

        public static readonly DependencyProperty TopicNameList =
            DependencyProperty.Register("TopicClassName", typeof(List<string>), typeof(TopicPanel), new PropertyMetadata("TextBox", new PropertyChangedCallback(OnTopicClassNameChange)));

        private static void OnTopicClassNameChange(object sender, DependencyPropertyChangedEventArgs args)
        {
            TopicPanel source = (TopicPanel)sender;
            
        }

        public string TopicContainerTitle
        {
            get { return (string)GetValue(TopicContainerTitleProperty); }

            set { SetValue(TopicContainerTitleProperty, value); }
        }

        static void OnTitleChange(object sender, DependencyPropertyChangedEventArgs args)
        {
            TopicPanel source = (TopicPanel)sender;
            source.TextBlockTopicClass.Text = (string)args.NewValue;
        }

        public TopicPanel()
        {
            InitializeComponent();
        }
    }
}
